<script setup lang='ts'>
import { ref, watch } from 'vue';

defineProps({
    allDataCount:Number
})
//向使用分条的父组件，实时提供当前页数
const emit = defineEmits(['updatePagin'])

const current = ref(1); //当前页数

watch(current,()=>{
    changePagin(current.value)
})
const changePagin = (pagin:number)=>{
    emit('updatePagin',{pagin:pagin})
}
</script>

<template>
<div class="position">
    <a-pagination v-model:current="current" :total=allDataCount :defaultPageSize="8" show-less-items />
</div>
</template>

<style scoped>
.position{
    margin-top:5vh;
    margin-left: 40%;
    padding-bottom: 3vh;
}
</style>